﻿@using Movi.Model
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@{
    var message = String.Empty;
    if (ViewData["ResponseMsg"] != null)
    {
        message = ViewData["ResponseMsg"].ToString();
    }

    var urlRequest = Request.QueryString;
    var urlGrabType = urlRequest["grabType"] ?? "Movie";
    var urlGrabCount = urlRequest["grabCount"] ?? "10";
}

<div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3">

            @using (Html.BeginForm("Grab", "Grab", new RouteValueDictionary { }, FormMethod.Get, new Dictionary<string, object> { { "class", "form-horizontal" } }))
            {
                <div class="form-group">
                    <h2 class="text-center">
                        data-collection service
                    </h2>
                </div>

                if (!String.IsNullOrEmpty(message))
                {
                    <div class="form-group">
                        <div class="alert alert-danger alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                            <strong>@(message)</strong>
                        </div>
                    </div>
                }

                <div class="form-group">
                    <label for="" class="control-label col-md-2">采集类型：</label>
                    <div class="col-md-10">
                        <select class="form-control" name="grabType">
                            <option value="Movie" @(urlGrabType=="Movie"?"selected":"")>电影</option>
                            <option value="Cartoon" @(urlGrabType == "Cartoon" ? "selected" : "")>动漫</option>
                            <option value="Teleplay" @(urlGrabType == "Teleplay" ? "selected" : "")>电视剧</option>

                        </select>
                        <span class="help-block">目前仅提供同一站点下 电影 / 动漫 / 电视剧 的采集。</span>
                    </div>
                </div>

                <div class="form-group">
                    <label for="" class="control-label col-md-2">采集数量：</label>
                    <div class="col-md-10">
                        <input class="form-control" type="number" value="@(urlGrabCount)" name="grabCount" />
                        <span class="help-block">如果为0，则采集所有，可能会耗费较长时间。</span>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-2 col-md-offset-5">
                        <input type="submit" value="开始" class="btn btn-success" />
                    </div>
                </div>
            }

        </div>
    </div>
</div>












